<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
    </h:head>
    <h:body>
        <ui:composition>
            <div>
                <h:form>
                    <div id="loggedInStatus">
                        <p>
                            <h:outputText value="Logged in as: " rendered="#{userSessionBean.loggedIn}" /> 
                            <h:outputText value="Not logged in." rendered="#{!userSessionBean.loggedIn}" /> 

                            <h:commandLink rendered="#{userSessionBean.loggedIn}" action="edit.jsf">#{userSessionBean.user.username}</h:commandLink>

                            <br/>
                        </p>
                        <p />
                    </div>
                    <div class="textCentered">
                        <a href="./" class="textCentered">
                            <h:graphicImage value="/resources/img/logo_part.png" />
                        </a>

                        <br/>
                        <div id="headerMenu">
                            <p>
                                <h:outputLink rendered="#{!userSessionBean.loggedIn}" value="./">Login</h:outputLink>
                                <h:outputLink rendered="#{userSessionBean.loggedIn}" value="./">Submit</h:outputLink>
                                | 
                                <a href="./browse">Browse Images</a> 
                                | 
                                <h:outputLink value="./register" rendered="#{!userSessionBean.loggedIn}">Register</h:outputLink>
                                <h:commandLink value="Logout" rendered="#{userSessionBean.loggedIn}" action="#{loginControllerBean.logout}">
                                    <f:ajax render="@all"/>
                                </h:commandLink>
                            </p>
                        </div>
                    </div>
                </h:form>
            </div>
        </ui:composition>
    </h:body>
</html>
